﻿Imports Microsoft.Reporting.WinForms

Public Class ReportViewerUserControl

    Public Sub SetReport()
        Select Case _ReportType
            Case ReportsList.SalesSummary
                'LoadSalesSummary()
            Case ReportsList.BillCumReceipt
                LoadBillCumReceipt()
            Case ReportsList.AdvPayReceipt
                LoadAdvPayReceipt()
            Case ReportsList.RegisterBill
                LoadBillRegister()
            Case ReportsList.RegisterPatient
                LoadPatientRegister()
            Case ReportsList.RegisterComplaints
                LoadRegisterDiseases()
            Case ReportsList.RegisterDoctors
                LoadRegisterDoctors()
            Case ReportsList.RegisterEmp
                LoadRegisterEmp()
            Case ReportsList.RegisterItems
                LoadRegisterItems(False)
            Case ReportsList.RegisterServices
                LoadRegisterItems(True)
            Case ReportsList.RegisterVendors
                LoadRegisterVendors()
            Case ReportsList.PrescriptionReport
                LoadPrescriptionReport()
        End Select
        ReportViewer1.RefreshReport()
    End Sub

    Private Sub LoadPrescriptionReport()
        Dim ReportDataSource1 As New ReportDataSource
        Dim ReportDataSource2 As New ReportDataSource
        Dim ReportDataSource3 As New ReportDataSource
        Dim ReportDataSource4 As New ReportDataSource
        Dim Proc_GetPatienVisitInfoBindingSource As System.Windows.Forms.BindingSource
        Dim PrescriptionDataSet As Horizon.HMS.PrescriptionDataSet
        Dim PatientInfoBindingSource As System.Windows.Forms.BindingSource
        Dim CompanyMasterBindingSource As System.Windows.Forms.BindingSource
        Dim DoctorInfoBindingSource As System.Windows.Forms.BindingSource
        Dim Proc_GetPatienVisitInfoTableAdapter As Horizon.HMS.PrescriptionDataSetTableAdapters.Proc_GetPatienVisitInfoTableAdapter
        Dim PatientInfoTableAdapter As Horizon.HMS.PrescriptionDataSetTableAdapters.PatientInfoTableAdapter
        Dim CompanyMasterTableAdapter As Horizon.HMS.PrescriptionDataSetTableAdapters.CompanyMasterTableAdapter
        Dim DoctorInfoTableAdapter As Horizon.HMS.PrescriptionDataSetTableAdapters.DoctorInfoTableAdapter

        PrescriptionDataSet = New Horizon.HMS.PrescriptionDataSet()
        Proc_GetPatienVisitInfoBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        Proc_GetPatienVisitInfoTableAdapter = New Horizon.HMS.PrescriptionDataSetTableAdapters.Proc_GetPatienVisitInfoTableAdapter()
        PatientInfoBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        PatientInfoTableAdapter = New Horizon.HMS.PrescriptionDataSetTableAdapters.PatientInfoTableAdapter()
        CompanyMasterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        CompanyMasterTableAdapter = New Horizon.HMS.PrescriptionDataSetTableAdapters.CompanyMasterTableAdapter()
        DoctorInfoBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        DoctorInfoTableAdapter = New Horizon.HMS.PrescriptionDataSetTableAdapters.DoctorInfoTableAdapter()
        CType(PrescriptionDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Proc_GetPatienVisitInfoBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(PatientInfoBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(CompanyMasterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(DoctorInfoBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "PrescriptionDS"
        ReportDataSource1.Value = Proc_GetPatienVisitInfoBindingSource
        ReportDataSource2.Name = "DSPatientInfo"
        ReportDataSource2.Value = PatientInfoBindingSource
        ReportDataSource3.Name = "ComInfoDataSet"
        ReportDataSource3.Value = CompanyMasterBindingSource
        ReportDataSource4.Name = "DrInfoDataSet"
        ReportDataSource4.Value = DoctorInfoBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource2)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource3)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource4)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.PrescriptionReport.rdlc"

        'PrescriptionDataSet
        '
        PrescriptionDataSet.DataSetName = "PrescriptionDataSet"
        PrescriptionDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'Proc_GetPatienVisitInfoBindingSource
        '
        Proc_GetPatienVisitInfoBindingSource.DataMember = "Proc_GetPatienVisitInfo"
        Proc_GetPatienVisitInfoBindingSource.DataSource = PrescriptionDataSet
        '
        'Proc_GetPatienVisitInfoTableAdapter
        '
        Proc_GetPatienVisitInfoTableAdapter.ClearBeforeFill = True
        '
        'PatientInfoBindingSource
        '
        PatientInfoBindingSource.DataMember = "PatientInfo"
        PatientInfoBindingSource.DataSource = PrescriptionDataSet
        '
        'PatientInfoTableAdapter
        '
        PatientInfoTableAdapter.ClearBeforeFill = True
        '
        'CompanyMasterBindingSource
        '
        CompanyMasterBindingSource.DataMember = "CompanyMaster"
        CompanyMasterBindingSource.DataSource = PrescriptionDataSet
        '
        'CompanyMasterTableAdapter
        '
        CompanyMasterTableAdapter.ClearBeforeFill = True
        '
        'DoctorInfoBindingSource
        '
        DoctorInfoBindingSource.DataMember = "DoctorInfo"
        DoctorInfoBindingSource.DataSource = PrescriptionDataSet
        '
        'DoctorInfoTableAdapter
        '
        DoctorInfoTableAdapter.ClearBeforeFill = True

        CType(PrescriptionDataSet, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Proc_GetPatienVisitInfoBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(PatientInfoBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(CompanyMasterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(DoctorInfoBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        Proc_GetPatienVisitInfoTableAdapter.Fill(PrescriptionDataSet.Proc_GetPatienVisitInfo, _PatientID, VisitID)
        PatientInfoTableAdapter.Fill(PrescriptionDataSet.PatientInfo, _PatientID)
        CompanyMasterTableAdapter.Fill(PrescriptionDataSet.CompanyMaster)
        DoctorInfoTableAdapter.Fill(PrescriptionDataSet.DoctorInfo, DrID)
    End Sub

    Private Sub LoadAdvPayReceipt()
        Dim BillPayDetailsBindingSource As System.Windows.Forms.BindingSource
        Dim AdvReceiptDataSrc As AdvReceiptDataSrc
        Dim CompanyMasterBindingSource As System.Windows.Forms.BindingSource
        Dim PatientRegistrationBindingSource As System.Windows.Forms.BindingSource
        Dim PatientPayDetailsBindingSource As System.Windows.Forms.BindingSource
        Dim BillPayDetailsTableAdapter As AdvReceiptDataSrcTableAdapters.BillPayDetailsTableAdapter
        Dim CompanyMasterTableAdapter As AdvReceiptDataSrcTableAdapters.CompanyMasterTableAdapter
        Dim PatientRegistrationTableAdapter As AdvReceiptDataSrcTableAdapters.PatientRegistrationTableAdapter
        Dim PatientPayDetailsTableAdapter As AdvReceiptDataSrcTableAdapters.PatientPayDetailsTableAdapter

        Dim ReportDataSource1 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource2 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource3 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource4 As New Microsoft.Reporting.WinForms.ReportDataSource()

        AdvReceiptDataSrc = New AdvReceiptDataSrc()
        BillPayDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        BillPayDetailsTableAdapter = New AdvReceiptDataSrcTableAdapters.BillPayDetailsTableAdapter()
        CompanyMasterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        CompanyMasterTableAdapter = New AdvReceiptDataSrcTableAdapters.CompanyMasterTableAdapter()
        PatientRegistrationBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        PatientRegistrationTableAdapter = New AdvReceiptDataSrcTableAdapters.PatientRegistrationTableAdapter()
        PatientPayDetailsBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        PatientPayDetailsTableAdapter = New AdvReceiptDataSrcTableAdapters.PatientPayDetailsTableAdapter()
        CType(AdvReceiptDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(BillPayDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(CompanyMasterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(PatientRegistrationBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(PatientPayDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "AdvReceiptDS"
        ReportDataSource1.Value = BillPayDetailsBindingSource
        ReportDataSource2.Name = "CompanyDS"
        ReportDataSource2.Value = CompanyMasterBindingSource
        ReportDataSource3.Name = "PatientPRegDS"
        ReportDataSource3.Value = PatientRegistrationBindingSource
        ReportDataSource4.Name = "PayDtlDS"
        ReportDataSource4.Value = PatientPayDetailsBindingSource
        ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        ReportViewer1.LocalReport.DataSources.Add(ReportDataSource2)
        ReportViewer1.LocalReport.DataSources.Add(ReportDataSource3)
        ReportViewer1.LocalReport.DataSources.Add(ReportDataSource4)
        ReportViewer1.LocalReport.ReportEmbeddedResource = "AdvanceReceipt.rdlc"

        '
        'AdvReceiptDataSrc
        '
        AdvReceiptDataSrc.DataSetName = "AdvReceiptDataSrc"
        AdvReceiptDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'BillPayDetailsBindingSource
        '
        BillPayDetailsBindingSource.DataMember = "BillPayDetails"
        BillPayDetailsBindingSource.DataSource = AdvReceiptDataSrc
        '
        'BillPayDetailsTableAdapter
        '
        BillPayDetailsTableAdapter.ClearBeforeFill = True
        '
        'CompanyMasterBindingSource
        '
        CompanyMasterBindingSource.DataMember = "CompanyMaster"
        CompanyMasterBindingSource.DataSource = AdvReceiptDataSrc
        '
        'CompanyMasterTableAdapter
        '
        CompanyMasterTableAdapter.ClearBeforeFill = True
        '
        'PatientRegistrationBindingSource
        '
        PatientRegistrationBindingSource.DataMember = "PatientRegistration"
        PatientRegistrationBindingSource.DataSource = AdvReceiptDataSrc
        '
        'PatientRegistrationTableAdapter
        '
        PatientRegistrationTableAdapter.ClearBeforeFill = True
        '
        'PatientPayDetailsBindingSource
        '
        PatientPayDetailsBindingSource.DataMember = "PatientPayDetails"
        PatientPayDetailsBindingSource.DataSource = AdvReceiptDataSrc
        '
        'PatientPayDetailsTableAdapter
        '
        PatientPayDetailsTableAdapter.ClearBeforeFill = True

        CType(AdvReceiptDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(BillPayDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(CompanyMasterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(PatientRegistrationBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(PatientPayDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit()


        BillPayDetailsTableAdapter.Fill(AdvReceiptDataSrc.BillPayDetails, _ID)
        CompanyMasterTableAdapter.Fill(AdvReceiptDataSrc.CompanyMaster)
        PatientRegistrationTableAdapter.Fill(AdvReceiptDataSrc.PatientRegistration, _PatientID)
        PatientPayDetailsTableAdapter.Fill(AdvReceiptDataSrc.PatientPayDetails, _ID, _PatientID)
    End Sub

    Private Sub LoadRegisterVendors()
        Dim SupplierMasterBindingSource As System.Windows.Forms.BindingSource
        Dim VendorDataSrc As VendorDataSrc
        Dim SupplierMasterTableAdapter As VendorDataSrcTableAdapters.SupplierMasterTableAdapter
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        VendorDataSrc = New VendorDataSrc()
        SupplierMasterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        SupplierMasterTableAdapter = New VendorDataSrcTableAdapters.SupplierMasterTableAdapter()
        CType(VendorDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(SupplierMasterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "VendorDataSet"
        ReportDataSource1.Value = SupplierMasterBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.VendorRegister.rdlc"

        '
        'VendorDataSrc
        '
        VendorDataSrc.DataSetName = "VendorDataSrc"
        VendorDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'SupplierMasterBindingSource
        '
        SupplierMasterBindingSource.DataMember = "SupplierMaster"
        SupplierMasterBindingSource.DataSource = VendorDataSrc
        '
        'SupplierMasterTableAdapter
        '
        SupplierMasterTableAdapter.ClearBeforeFill = True

        CType(VendorDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(SupplierMasterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()

        SupplierMasterTableAdapter.Fill(VendorDataSrc.SupplierMaster)
    End Sub

    Private Sub LoadRegisterItems(ByVal IsSrv As Boolean)
        Dim ViewItemsServicesBindingSource As System.Windows.Forms.BindingSource
        Dim ItemsServicesDataSrc As ItemsServicesDataSrc
        Dim ViewItemsServicesTableAdapter As ItemsServicesDataSrcTableAdapters.ViewItemsServicesTableAdapter
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        ItemsServicesDataSrc = New ItemsServicesDataSrc()
        ViewItemsServicesBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        ViewItemsServicesTableAdapter = New ItemsServicesDataSrcTableAdapters.ViewItemsServicesTableAdapter()
        CType(ItemsServicesDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(ViewItemsServicesBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "ItemsServicesDataSet"
        ReportDataSource1.Value = ViewItemsServicesBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        If IsSrv = True Then
            Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.ServicesRegister.rdlc"
        Else
            Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.ItemsRegister.rdlc"
        End If
        '
        'ItemsServicesDataSrc
        '
        ItemsServicesDataSrc.DataSetName = "ItemsServicesDataSrc"
        ItemsServicesDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'ViewItemsServicesBindingSource
        '
        ViewItemsServicesBindingSource.DataMember = "ViewItemsServices"
        ViewItemsServicesBindingSource.DataSource = ItemsServicesDataSrc
        '
        'ViewItemsServicesTableAdapter
        '
        ViewItemsServicesTableAdapter.ClearBeforeFill = True

        CType(ItemsServicesDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(ViewItemsServicesBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        If IsSrv = True Then
            ViewItemsServicesTableAdapter.FillServicesBy(ItemsServicesDataSrc.ViewItemsServices)
        Else
            ViewItemsServicesTableAdapter.FillItems(ItemsServicesDataSrc.ViewItemsServices)
        End If

    End Sub

    Private Sub LoadRegisterEmp()
        Dim ViewEmpRegisterBindingSource As System.Windows.Forms.BindingSource
        Dim EmpRegisterDataSrc As EmpRegisterDataSrc
        Dim ViewEmpRegisterTableAdapter As EmpRegisterDataSrcTableAdapters.ViewEmpRegisterTableAdapter
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        EmpRegisterDataSrc = New EmpRegisterDataSrc()
        ViewEmpRegisterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        ViewEmpRegisterTableAdapter = New EmpRegisterDataSrcTableAdapters.ViewEmpRegisterTableAdapter()
        CType(EmpRegisterDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(ViewEmpRegisterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "EmpRegisterDataSet"
        ReportDataSource1.Value = ViewEmpRegisterBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.EmpRegister.rdlc"

        '
        'EmpRegisterDataSrc
        '
        EmpRegisterDataSrc.DataSetName = "EmpRegisterDataSrc"
        EmpRegisterDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'ViewEmpRegisterBindingSource
        '
        ViewEmpRegisterBindingSource.DataMember = "ViewEmpRegister"
        ViewEmpRegisterBindingSource.DataSource = EmpRegisterDataSrc
        '
        'ViewEmpRegisterTableAdapter
        '
        ViewEmpRegisterTableAdapter.ClearBeforeFill = True

        CType(EmpRegisterDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(ViewEmpRegisterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()

        ViewEmpRegisterTableAdapter.Fill(EmpRegisterDataSrc.ViewEmpRegister)
    End Sub

    Private Sub LoadRegisterDoctors()
        Dim ViewDrRegisterBindingSource As System.Windows.Forms.BindingSource
        Dim DrRegisterDataSrc As DrRegisterDataSrc
        Dim ViewDrRegisterTableAdapter As DrRegisterDataSrcTableAdapters.ViewDrRegisterTableAdapter
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        DrRegisterDataSrc = New DrRegisterDataSrc()
        ViewDrRegisterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        ViewDrRegisterTableAdapter = New DrRegisterDataSrcTableAdapters.ViewDrRegisterTableAdapter()
        CType(DrRegisterDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(ViewDrRegisterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()


        ReportDataSource1.Name = "DrRegisterDataSet"
        ReportDataSource1.Value = ViewDrRegisterBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.DrRegister.rdlc"

        '
        'DrRegisterDataSrc
        '
        DrRegisterDataSrc.DataSetName = "DrRegisterDataSrc"
        DrRegisterDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'ViewDrRegisterBindingSource
        '
        ViewDrRegisterBindingSource.DataMember = "ViewDrRegister"
        ViewDrRegisterBindingSource.DataSource = DrRegisterDataSrc
        '
        'ViewDrRegisterTableAdapter
        '
        ViewDrRegisterTableAdapter.ClearBeforeFill = True

        CType(DrRegisterDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(ViewDrRegisterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        ViewDrRegisterTableAdapter.Fill(DrRegisterDataSrc.ViewDrRegister)
    End Sub

    Private Sub LoadRegisterDiseases()
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim DiseasesMasterBindingSource As System.Windows.Forms.BindingSource
        Dim DiseasesDataSrc As DiseasesDataSrc
        Dim DiseasesMasterTableAdapter As DiseasesDataSrcTableAdapters.DiseasesMasterTableAdapter

        DiseasesDataSrc = New DiseasesDataSrc()
        DiseasesMasterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        DiseasesMasterTableAdapter = New DiseasesDataSrcTableAdapters.DiseasesMasterTableAdapter()
        CType(DiseasesDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(DiseasesMasterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        ReportDataSource1.Name = "DiseasesDataSet"
        ReportDataSource1.Value = DiseasesMasterBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.DiseasesRegister.rdlc"
        '
        'DiseasesDataSrc
        '
        DiseasesDataSrc.DataSetName = "DiseasesDataSrc"
        DiseasesDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'DiseasesMasterBindingSource
        '
        DiseasesMasterBindingSource.DataMember = "DiseasesMaster"
        DiseasesMasterBindingSource.DataSource = DiseasesDataSrc
        '
        'DiseasesMasterTableAdapter
        '
        DiseasesMasterTableAdapter.ClearBeforeFill = True
        CType(DiseasesDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(DiseasesMasterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()

        DiseasesMasterTableAdapter.Fill(DiseasesDataSrc.DiseasesMaster)
    End Sub

    Private Sub LoadBillRegister()
        Dim ViewBillRegisterBindingSource As System.Windows.Forms.BindingSource
        Dim BillRegisterDataSrc As BillRegisterDataSrc
        Dim ViewBillRegisterTableAdapter As BillRegisterDataSrcTableAdapters.ViewBillRegisterTableAdapter
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        BillRegisterDataSrc = New BillRegisterDataSrc()
        ViewBillRegisterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        ViewBillRegisterTableAdapter = New BillRegisterDataSrcTableAdapters.ViewBillRegisterTableAdapter()
        CType(BillRegisterDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(ViewBillRegisterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        ReportDataSource1.Name = "BillRegisterDataSet"
        ReportDataSource1.Value = ViewBillRegisterBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.BillRegister.rdlc"
        '
        'BillRegisterDataSrc
        '
        BillRegisterDataSrc.DataSetName = "BillRegisterDataSrc"
        BillRegisterDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'ViewBillRegisterBindingSource
        '
        ViewBillRegisterBindingSource.DataMember = "ViewBillRegister"
        ViewBillRegisterBindingSource.DataSource = BillRegisterDataSrc
        '
        'ViewBillRegisterTableAdapter
        '
        ViewBillRegisterTableAdapter.ClearBeforeFill = True
        CType(BillRegisterDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(ViewBillRegisterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()

        ViewBillRegisterTableAdapter.Fill(BillRegisterDataSrc.ViewBillRegister)
    End Sub

    Private Sub LoadPatientRegister()
        Dim ViewPatientRegisterBindingSource As System.Windows.Forms.BindingSource
        Dim PatientRegisterDataSrc As PatientRegisterDataSrc
        Dim ViewPatientRegisterTableAdapter As PatientRegisterDataSrcTableAdapters.ViewPatientRegisterTableAdapter
        Dim ReportDataSource1 As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource()
        PatientRegisterDataSrc = New PatientRegisterDataSrc()
        ViewPatientRegisterBindingSource = New System.Windows.Forms.BindingSource(Me.components)
        ViewPatientRegisterTableAdapter = New PatientRegisterDataSrcTableAdapters.ViewPatientRegisterTableAdapter()
        CType(PatientRegisterDataSrc, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(ViewPatientRegisterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "PatientRegisterDataSet"
        ReportDataSource1.Value = ViewPatientRegisterBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.PatientRegister.rdlc"
        '
        'PatientRegisterDataSrc
        '
        PatientRegisterDataSrc.DataSetName = "PatientRegisterDataSrc"
        PatientRegisterDataSrc.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'ViewPatientRegisterBindingSource
        '
        ViewPatientRegisterBindingSource.DataMember = "ViewPatientRegister"
        ViewPatientRegisterBindingSource.DataSource = PatientRegisterDataSrc
        '
        'ViewPatientRegisterTableAdapter
        '
        ViewPatientRegisterTableAdapter.ClearBeforeFill = True
        CType(PatientRegisterDataSrc, System.ComponentModel.ISupportInitialize).EndInit()
        CType(ViewPatientRegisterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()

        ViewPatientRegisterTableAdapter.Fill(PatientRegisterDataSrc.ViewPatientRegister)
    End Sub

    Private Sub LoadBillCumReceipt()
        Dim BillingMasterBindingSource As New System.Windows.Forms.BindingSource
        Dim BillCumRecieptDataSet As New BillCumRecieptDataSet
        Dim CompanyMasterBindingSource As New System.Windows.Forms.BindingSource
        Dim BillPayDetailsBindingSource As New System.Windows.Forms.BindingSource
        Dim BillServiceDetailsBindingSource As New System.Windows.Forms.BindingSource
        Dim BillChargesDetailsBindingSource As New System.Windows.Forms.BindingSource
        Dim BillingMasterTableAdapter As New BillCumRecieptDataSetTableAdapters.BillingMasterTableAdapter
        Dim CompanyMasterTableAdapter As New BillCumRecieptDataSetTableAdapters.CompanyMasterTableAdapter
        Dim BillPayDetailsTableAdapter As New BillCumRecieptDataSetTableAdapters.BillPayDetailsTableAdapter
        Dim BillServiceDetailsTableAdapter As New BillCumRecieptDataSetTableAdapters.BillServiceDetailsTableAdapter
        Dim BillChargesDetailsTableAdapter As New BillCumRecieptDataSetTableAdapters.BillChargesDetailsTableAdapter
        Dim ReportDataSource1 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource2 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource3 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource4 As New Microsoft.Reporting.WinForms.ReportDataSource()
        Dim ReportDataSource5 As New Microsoft.Reporting.WinForms.ReportDataSource()
        CType(BillCumRecieptDataSet, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(BillingMasterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(CompanyMasterBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(BillPayDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(BillServiceDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(BillChargesDetailsBindingSource, System.ComponentModel.ISupportInitialize).BeginInit()

        ReportDataSource1.Name = "DSBillingMaster"
        ReportDataSource1.Value = BillingMasterBindingSource
        ReportDataSource2.Name = "DSComMast"
        ReportDataSource2.Value = CompanyMasterBindingSource
        ReportDataSource3.Name = "DSBillPay"
        ReportDataSource3.Value = BillPayDetailsBindingSource
        ReportDataSource4.Name = "DSBillSrvDtl"
        ReportDataSource4.Value = BillServiceDetailsBindingSource
        ReportDataSource5.Name = "DSBillCharges"
        ReportDataSource5.Value = BillChargesDetailsBindingSource
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource1)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource2)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource3)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource4)
        Me.ReportViewer1.LocalReport.DataSources.Add(ReportDataSource5)
        Me.ReportViewer1.LocalReport.ReportEmbeddedResource = "Horizon.HMS.BillCumReceipt.rdlc"
        '
        'BillCumRecieptDataSet
        '
        BillCumRecieptDataSet.DataSetName = "BillCumRecieptDataSet"
        BillCumRecieptDataSet.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
        '
        'BillingMasterBindingSource
        '
        BillingMasterBindingSource.DataMember = "BillingMaster"
        BillingMasterBindingSource.DataSource = BillCumRecieptDataSet
        '
        'BillingMasterTableAdapter
        '
        BillingMasterTableAdapter.ClearBeforeFill = True
        '
        'CompanyMasterBindingSource
        '
        CompanyMasterBindingSource.DataMember = "CompanyMaster"
        CompanyMasterBindingSource.DataSource = BillCumRecieptDataSet
        '
        'CompanyMasterTableAdapter
        '
        CompanyMasterTableAdapter.ClearBeforeFill = True
        '
        'BillPayDetailsBindingSource
        '
        BillPayDetailsBindingSource.DataMember = "BillPayDetails"
        BillPayDetailsBindingSource.DataSource = BillCumRecieptDataSet
        '
        'BillPayDetailsTableAdapter
        '
        BillPayDetailsTableAdapter.ClearBeforeFill = True
        '
        'BillServiceDetailsBindingSource
        '
        BillServiceDetailsBindingSource.DataMember = "BillServiceDetails"
        BillServiceDetailsBindingSource.DataSource = BillCumRecieptDataSet
        '
        'BillServiceDetailsTableAdapter
        '
        BillServiceDetailsTableAdapter.ClearBeforeFill = True
        '
        'BillChargesDetailsBindingSource
        '
        BillChargesDetailsBindingSource.DataMember = "BillChargesDetails"
        BillChargesDetailsBindingSource.DataSource = BillCumRecieptDataSet
        '
        'BillChargesDetailsTableAdapter
        '
        BillChargesDetailsTableAdapter.ClearBeforeFill = True
        CType(BillCumRecieptDataSet, System.ComponentModel.ISupportInitialize).EndInit()
        CType(BillingMasterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(CompanyMasterBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(BillPayDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(BillServiceDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit()
        CType(BillChargesDetailsBindingSource, System.ComponentModel.ISupportInitialize).EndInit()

        BillingMasterTableAdapter.Fill(BillCumRecieptDataSet.BillingMaster, _ID)
        CompanyMasterTableAdapter.Fill(BillCumRecieptDataSet.CompanyMaster)
        BillPayDetailsTableAdapter.Fill(BillCumRecieptDataSet.BillPayDetails, _ID)
        BillServiceDetailsTableAdapter.Fill(BillCumRecieptDataSet.BillServiceDetails, _ID, 0)
        BillChargesDetailsTableAdapter.Fill(BillCumRecieptDataSet.BillChargesDetails, _ID)
    End Sub

    Dim _StartDate As Date = "1/1/1900"
    Public WriteOnly Property StartDate As Date
        Set(ByVal value As Date)
            _StartDate = value
        End Set
    End Property

    Dim _EndDate As Date = "1/1/1900"
    Public WriteOnly Property EndDate As Date
        Set(ByVal value As Date)
            _EndDate = value
        End Set
    End Property

    Dim _ID As Integer
    Public WriteOnly Property ID As Integer
        Set(ByVal value As Integer)
            _ID = value
        End Set
    End Property

    Dim _PatientID As Integer
    Public WriteOnly Property PatientID As Integer
        Set(ByVal value As Integer)
            _PatientID = value
        End Set
    End Property

    Public Property VisitID As Integer

    Public Property DrID As Integer

    Dim _ReportType As ReportsList
    Public WriteOnly Property ReportType As ReportsList
        Set(ByVal value As ReportsList)
            _ReportType = value
        End Set
    End Property

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
End Class


Public Enum ReportsList
    None
    AdvPayReceipt
    BillCumReceipt
    SalesSummary
    InwordStockSummary
    PurchaseSummary
    ExpenseSummary
    MonthlyShopStock
    MonthlySalesChart
    DailyJournals
    PaymentDues
    RegisterPatient
    RegisterBill
    RegisterEmp
    RegisterItems
    RegisterDoctors
    RegisterServices
    RegisterVendors
    RegisterComplaints
    PrescriptionReport
End Enum